package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

class ztt {
   static void a(zok var0, zcfx var1) throws Exception {
      ArrayList var2 = new ArrayList();
      byte var3 = 1;
      zqe var4 = null;
      StringBuilder var10002 = (new StringBuilder()).append("rId");
      int var7 = var3 + 1;
      var4 = new zqe(var10002.append(var3).toString(), "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "xl/workbook.xml", (String)null);
      com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      var4 = new zqe("rId" + var7++, "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", "docProps/core.xml", (String)null);
      com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      var4 = new zqe("rId" + var7++, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", "docProps/app.xml", (String)null);
      com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      if (var0.h()) {
         var4 = new zqe("rId" + var7++, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties", "docProps/custom.xml", (String)null);
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      if (var0.a.b != null && var0.a.b.j.size() > 0) {
         for(int var5 = 0; var5 < var0.a.b.j.size(); ++var5) {
            zqe var6 = (zqe)var0.a.b.j.get(var5);
            var4 = new zqe("rId" + var7++, var6.d, var6.e, var6.f);
            com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
         }
      }

      zps var8 = var0.a.b;
      if (var0.a.getRibbonXml() != null && var0.a.getRibbonXml().length() > 0) {
         var4 = new zqe("R1d1daea4c3c14db5", "http://schemas.microsoft.com/office/2007/relationships/ui/extensibility", var0.C, (String)null);
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      a(var1, var2);
   }

   static void b(zok var0, zcfx var1) throws Exception {
      ArrayList var2 = new ArrayList();
      zqe var3 = new zqe("rId3", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", "docProps/app.xml", (String)null);
      com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      if (var0.h()) {
         var3 = new zqe("rId4", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties", "docProps/custom.xml", (String)null);
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      }

      var3 = new zqe("rId2", "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", "docProps/core.xml", (String)null);
      com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      var3 = new zqe("rId1", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "xl/workbook.bin", (String)null);
      com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      a(var1, var2);
   }

   static void a(zcfx var0, ArrayList var1) throws Exception {
      var0.b(true);
      var0.b("Relationships");
      var0.a((String)null, "xmlns", (String)null, "http://schemas.openxmlformats.org/package/2006/relationships");

      for(int var2 = 0; var2 < var1.size(); ++var2) {
         zqe var3 = (zqe)var1.get(var2);
         a(var0, var3);
      }

      var0.b();
      var0.d();
      var0.e();
   }

   static void a(zcfx var0, HashMap var1) throws Exception {
      var0.b(true);
      var0.b("Relationships");
      var0.a((String)null, "xmlns", (String)null, "http://schemas.openxmlformats.org/package/2006/relationships");
      Iterator var2 = var1.values().iterator();

      while(var2.hasNext()) {
         zqe var3 = (zqe)var2.next();
         a(var0, var3);
      }

      var0.b();
      var0.d();
      var0.e();
   }

   static void a(zcfx var0, zqe var1) throws Exception {
      var0.b("Relationship");
      var0.a("Id", var1.c);
      var0.a("Type", var1.d);
      var0.a("Target", zase.a(var1.e));
      if (var1.f != null && var1.f.length() != 0) {
         var0.a("TargetMode", var1.f);
      }

      var0.b();
   }
}
